<?php


$current_path = dirname(__FILE__);
define('CF_BASE',$current_path);

/*
|---------------------------------------------------------------
| DEFINE APPLICATION CONSTANTS
|---------------------------------------------------------------
|
| CF_CLASSES		- Path to Classes directory
| CF_FUNCTIONS		- Path to Functions directory
| CF_JS	- Path to supporting JS (ensure in a web accesable directory)
| CF_BASE	- Path to base (without trailing slash)
| CF_CSS	- Path the the library of CF related CSS files
| CF_LIB	- Path the the library directory (using structure default for CF)
*/
define('CF_CLASSES',$current_path . '/' . 'CF_Classes/');
define('CF_FUNCTIONS',$current_path . '/' . 'CF_Functions/');

define('CF_LIB',$current_path . '/' . 'lib/');

define('CF_REL_LIB', 'CFClass/lib/');
define('CF_JS', 'CFClass/CF_JS/');
define('CF_CSS','CFClass/CF_CSS/');
function CF_autoload($className){
//	echo "LOOKING FOR $className";
	if (strpos($className, 'CF_') === 0) {
		$class =  CF_CLASSES . $className . '.php';
		if (file_exists($class)) {
            require $class;
            return true;
        }

		
	}
		// check for custom classes / class extensions in the path defined by 'CF_CUSTOM_PATH'.  This would be defined in another (driver or plugin) file
		if(defined('CF_CUSTOM_PATH')){
			$class =  CF_CUSTOM_PATH . $className . '.php';
			if (file_exists($class)) {
//				echo "Checking: $class";
	            require $class;
	            return true;
	        }		
		}	
	
//	echo "CANT FIND $className";
	return false;

}


//print 'CF_BASE :' . CF_BASE;

?>